package com.ouc.service.impl;

import com.ouc.entity.Frame;
import com.ouc.mapper.FrameMapper;
import com.ouc.service.FrameService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.validation.beanvalidation.SpringConstraintValidatorFactory;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Name: FrameServiceImpl
 * @Description:
 * @Author: Mr.Tong
 */
@Service
public class FrameServiceImpl implements FrameService {

    @Autowired
    private FrameMapper frameMapper;


    @Override
    public Boolean insertFrame(Frame frame) {
        return frameMapper.insertFrame(frame);
    }

    @Override
    public Frame getFrameById(Integer id) {
        return frameMapper.getFrameById(id);
    }

    @Override
    public List<Frame> getAllFrame() {
        return frameMapper.getAllFrame();
    }

    @Override
    public Frame getFrameByFrameCode(String frameCode) {
        return frameMapper.getFrameByFrameCode(frameCode);
    }

    @Override
    public Boolean deleteFrameById(Integer id) {
        return frameMapper.deleteFrameById(id);
    }

    @Override
    public Boolean deleteFrameByFrameCode(String frameCode) {
        return frameMapper.deleteFrameByFrameCode(frameCode);
    }

    @Override
    public Boolean frameExists(String frameCode) {
        return this.getFrameByFrameCode(frameCode) != null;
    }
}
